package cn.neusoft.luofa603.yuejian_29.fragment;


import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

import cn.neusoft.luofa603.yuejian_29.R;
import cn.neusoft.luofa603.yuejian_29.adapter.ClubAdapter;
import cn.neusoft.luofa603.yuejian_29.adapter.ClubTabAdapter;
import cn.neusoft.luofa603.yuejian_29.adapter.UnionAdapter;


public class ClubFragment extends Fragment {
    private View view;
    private TabLayout tabs;
    private ViewPager viewPager;
    private List<String> mTitle = new ArrayList<String>();
    private List<Fragment> mFragment = new ArrayList<Fragment>();


    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
         view = inflater.inflate(R.layout.club_fragment, container, false);
        initviews();
        initEvents();
        initData();
        ClubTabAdapter clubTabAdapter = new ClubTabAdapter(getChildFragmentManager(),mTitle,mFragment);
        viewPager.setAdapter(clubTabAdapter);
        tabs.setupWithViewPager(viewPager);
        return view;

    }
    public void initviews(){
        tabs = (TabLayout) view.findViewById(R.id.club_ty);
        viewPager = (ViewPager) view.findViewById(R.id.club_vp);
        mTitle.add("最具人气");
        mTitle.add("离我最近");
        mFragment.add(new RenQiFragment());
        mFragment.add(new ZuiJinFragment());


    }
    public void initEvents(){



    }
    public void initData(){

    }
}
